package com.andova.component.net;

import androidx.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import static com.andova.component.net.ResponseCode.ERROR_CONNECT;
import static com.andova.component.net.ResponseCode.ERROR_ILLEGAL_ARGUMENT;
import static com.andova.component.net.ResponseCode.ERROR_JSON_SYNTAX;
import static com.andova.component.net.ResponseCode.ERROR_NO_NETWORK;
import static com.andova.component.net.ResponseCode.ERROR_NO_ROUTE_TO_HOST;
import static com.andova.component.net.ResponseCode.ERROR_SSL_HANDSHAKE;
import static com.andova.component.net.ResponseCode.ERROR_TIMEOUT;
import static com.andova.component.net.ResponseCode.ERROR_UNKNOWN;
import static com.andova.component.net.ResponseCode.ERROR_UNKNOWN_HOST;
import static com.andova.component.net.ResponseCode.ERROR_URL2SERVER;
import static com.andova.component.net.ResponseCode.RESPONSE_EMPTY;
import static com.andova.component.net.ResponseCode.RESPONSE_SUCCESS;

/**
 * Created by Administrator on 2017-12-05.
 * <p>响应枚举</p>
 *
 * @author kzaxil
 * @since 1.0.1
 */
@Deprecated
@IntDef(value = {ERROR_URL2SERVER, RESPONSE_EMPTY, RESPONSE_SUCCESS,
        ERROR_JSON_SYNTAX, ERROR_TIMEOUT, ERROR_CONNECT, ERROR_UNKNOWN,
        ERROR_SSL_HANDSHAKE, ERROR_NO_NETWORK, ERROR_NO_ROUTE_TO_HOST,
        ERROR_UNKNOWN_HOST, ERROR_ILLEGAL_ARGUMENT})
@Retention(RetentionPolicy.SOURCE)
public @interface ResponseCode {
    /**
     * 连接地址或服务端响应出错信息
     */
    int ERROR_URL2SERVER = 0x50;
    /**
     * 服务端响应的内容数据为空
     */
    int RESPONSE_EMPTY = 0x51;
    int RESPONSE_SUCCESS = 0x52;
    /**
     * 数据解析异常
     */
    int ERROR_JSON_SYNTAX = 0x53;
    /**
     * 连接超时异常
     */
    int ERROR_TIMEOUT = 0x54;
    /**
     * 连接出错
     */
    int ERROR_CONNECT = 0x55;
    /**
     * 未知的错误
     */
    int ERROR_UNKNOWN = 0x56;
    /**
     * SSL证书错误
     */
    int ERROR_SSL_HANDSHAKE = 0x57;
    /**
     * 网络未连接
     */
    int ERROR_NO_NETWORK = 0x58;
    /**
     * 没有到主机的路由
     */
    int ERROR_NO_ROUTE_TO_HOST = 0x59;
    int ERROR_UNKNOWN_HOST = 0x60;
    int ERROR_ILLEGAL_ARGUMENT = 0x61;
    int WAITING_NEXT = 0x99;
}